package com.cool.feiyan.ui.home

import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.cool.feiyan.FeiYanData
import com.cool.feiyan.QueryData

class HomeViewModel : ViewModel() {

    private val _text = MutableLiveData<String>().apply {
        value = "新型冠状病毒感染的肺炎确诊患者\n同行程查询工具"
    }
    val text: LiveData<String> = _text

    private val _data = MutableLiveData<MutableList<FeiYanData>>().apply {
        //var queryData : QueryData = QueryData()
        //queryData.QueryAsync()
        //value = queryData.ParseJson()
        //Log.d("_data", (value as MutableList<FeiYanData>).size.toString())
        // 使用时，需要每次查询都更新数据，所以先不用这里的 ViewModel 了。
    }
    val data : LiveData<MutableList<FeiYanData>> = _data
}